<?

//Calcule du marche
//*****************
REQUIRE("../../protect/connect.php");

$query="SELECT batiment_ville, batiment_user FROM SDBatiment WHERE batiment_idbatiment=21 GROUP BY batiment_ville";
$resultat=mysql_query($query);

WHILE ($element=mysql_fetch_array($resultat)){ //While.

$query="SELECT ville_population FROM SDville WHERE ville_id=$element[0]";
$resultat2=mysql_query($query);
$tmp=mysql_fetch_array($resultat2);

$lorin=floor($tmp[0]/200);

$query="UPDATE Sduser_perso SET perso_lorin=perso_lorin+$lorin WHERE perso_id=$element[1]";
$resultat2=mysql_query($query);





}//Fin du while.
mysql_close;
?>
